package com.cskaoyan.mall.controller.admin;

import com.cskaoyan.mall.bean.ProvinceAndCity;
import com.cskaoyan.mall.bean.Region;
import com.cskaoyan.mall.bean.vo.ResultVO;
import com.cskaoyan.mall.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("admin/region")
public class RegionController {

    @Autowired
    RegionService regionService;

    @GetMapping("list")
    public ResultVO list(){
        List<ProvinceAndCity> list = regionService.queryRegionList();
        return ResultVO.ok(list.toArray());
    }
}
